<template>
  <!--双优化验收情况汇总表年初累计)-->
   <a-table class="takeOut-hover" :columns="columns" bordered :pagination="false" :data-source="tableData">
    <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record,index">
       {{noValue(record[col.dataIndex],index,col.dataIndex)}}
     </template>
  </a-table>
</template>
<script>
import { summaryMixin } from "./mergeCell";
export default {
  mixins:[summaryMixin], //混入文件
  name: 'a' + Date.now(),
  props: {
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    this.columns = [
      { title: '序号', align: 'center', dataIndex: 'serial',width:'4%',scopedSlots: { customRender: 'serial' } },
      {title: '所属分公司',align: 'center',dataIndex: 'branchComName',ellipsis: true,width:'19%',scopedSlots: { customRender: 'branchComName' },
       customRender: (value, row, index) => { 
        const obj = {
            children: value,
            attrs: {}
          }
          if(index === this.tableData.length - 1){
           obj.attrs.colSpan = 2;
           obj.children = '合计';
          }
          return obj
        }
      },
      { title: '所属项目名称', align: 'center', dataIndex: 'projectName', width:'11%',scopedSlots: { customRender: 'projectName' },
        customRender: (value, row, index) => { 
          const obj = {
            children: row.projectName,
            attrs: {}
          }
          if(index === this.tableData.length - 1){
           obj.attrs.colSpan = 0;
          }
          
          return obj
        }
      
       
      },
      { title: '验收总数(项)', dataIndex: 'acceptanceNum', align: 'center', ellipsis: false, width:'11%',scopedSlots: { customRender: 'acceptanceNum' }},
      { title: '验收效益额(万元)', dataIndex: 'acceptanceFee', align: 'center', ellipsis: false, width:'11%',scopedSlots: { customRender: 'acceptanceFee' }},
      { title: '设计优化数(项)', dataIndex: 'designNum', align: 'center', ellipsis: false, width:'11%',scopedSlots: { customRender: 'designNum' }},
      { title: '设计优化效益额(万元)', dataIndex: 'designFee', align: 'center', ellipsis: false,width:'11%',scopedSlots: { customRender: 'designFee' }},
      { title: '方案优化数(项)', dataIndex: 'planNum', align: 'center', ellipsis: false,width:'11%',scopedSlots: { customRender: 'planNum' }},
     { title: '方案优化效益额（万元）', dataIndex: 'planFee', align: 'center', ellipsis: false,width:'11%',scopedSlots: { customRender: 'planFee' }},
    ]
    return {
    }
  },
  methods: {
  },
  mounted() {
  }
}
</script>
<style lang="less">
</style>
